/**
 * Created by Administrator on 2017/3/22.
 */
$(document).ready(function(){
    $("#suggest_submit").on("click",function () {
        $.ajax({
            url: "/module/suggest.action",
            type: "post",
            dataType: "json",
            data: {
                userName: $("#userName").val(),
                userPhone: $("#userPhone").val(),
                userEmail: $("#userEmail").val(),
                content: $("#content").val()
            },
            success: function (data) {
                if(data.status == "suggest_succeed"){
                    confirm("建议提交成功");
                    window.location.reload();
                }else if(data.status == "suggest_succeed"){
                    alert("建议提交到数据库时失败");
                }
            },
            error: function (e) {
                alert("提交建议到后台失败："+e);
            }
        });
    });
});